
import config from '../../../common/scripts/config.js'
// import Request from '../../../common/scripts/request.js'
// import Request from '../../../common/scripts/request/dev-request.js'
import Request from '../../../common/scripts/request/pro-request.js'
// import Request from '../../../common/scripts/request/test-request.js'

/**
 * 业务方法的封装类
 * @author 周亮
 * @createDate 2019-05-22
 * @notice
 */
class PayService {
	
	constructor() {
		this.request = new Request()
		this.config = config
	}
	
	/**
	 * 支付接口
	 * @param {Object} options
	 */
	toPay(options) {
		return this.request.post('/appapi.php?g=Appapi&c=Pay&a=go_pay', options, 'test')
	}
	
	/**
	 * 支付 check 接口
	 * @param {Object} options
	 */
	toCheck(options) {
		return this.request.post('/appapi.php?g=Appapi&c=Pay&a=check', options, 'test')
	}
	
	/**
	 * 获取订单详情接口
	 * @param {Object} options
	 */
	getOrderInfo(options) {
		return this.request.get('/appapi.php?g=Appapi&c=Pay&a=get_order_detail', options, 'test')
	}
	
	/**
	 * 支付后的回调接口
	 * @param {Object} options
	 */
	payBack(options) {
		return this.request.post('/appapi.php?g=Appapi&c=Pay&a=app_weixin_back', options, 'test')
	}
	
}

export default PayService
